var $ = jquery = layui.jquery;
var layer = layui.layer;
var upload =layui.upload;

// use_shcoll
$("#addschoolBtn").click(function(){
    layer.open({
        type: 1,
        title:"添加学校",
        content: $('#controladdSchool'),
        area:["600px","400px"],
        btn: ['确定', '取消'],
        yes: function(index, layero){
           alert("点击了确认");
          layer.close(index); 
        }
   });
})

$("body").on("click","#use_schoolTable .edit",function(){
    layer.open({
        type: 1,
        title:"编辑学校",
        content: $('#controlEditSchool'),
        area:["600px","400px"],
        btn: ['确定', '取消'],
        yes: function(index, layero){
           alert("点击了确认");
          layer.close(index); 
        }
   });
})

$("body").on("click","#use_schoolTable .del",function(){
    layer.confirm('确认要 <span class="red">禁用</span> 该学校/用户所有账号吗？', {icon: 3, title:'提示'}, function(index){
        alert("点击了确认");
          layer.close(index);
        });
})

$("body").on("click","#use_schoolTable .add",function(){
    layer.open({
        type: 1,
        title:"添加用户",
        content: $('#controladdSchoolUser'),
        area:["500px","400px"],
        btn: ['确定', '取消'],
        yes: function(index, layero){
           alert("点击了确认");
          layer.close(index); 
        }
   });
})


//文件上传
		  upload.render({ 
		    elem: '#upFileBtn'
		    ,url: '/upload/'
		    ,accept: 'file' 
		    ,exts:'xlsx'
		    ,done: function(res){
		      console.log(res)
		    }
		  });